Function IsOnFloor (xPosF As Integer, xPosB As Integer, yPos As Integer)
    Dim si As Integer
    Dim assetMapX As Integer
    Dim assetMapY As Integer
    Dim otherP As Integer
    Dim otherpX As Integer
    Dim otherpY As Integer

    IsOnFloor = 0
    $Console
    '_Echo " xf y pos " + Str$(xPosF) + "," + Str$(yPos) + "xPosb " + Str$(xPosB)
    'If currMap(xPosF, yPos + 1).code = "w" Or currMap(xPosB, yPos + 1).code = "w" Then
    If currMap(xPosB, yPos + 1).code = "w" Then
        IsOnFloor = 1
    End If
    ' Check if on top of an asset
    If IsOnFloor = 0 Then

        For si = 1 To UBound(gameAssets)

            If gameAssets(si).mapNo = currMapNo And gameAssets(si).status < 9 Then ' Is the asset located on the current map and active
                assetMapX = (Int(gameAssets(si).x / tileSize) * tileSize) / tileSize
                assetMapY = (Int(gameAssets(si).y / tileSize) * tileSize) / tileSize
                ' _Echo "Asset x y pos " + Str$(assetMapX) + "," + Str$(assetMapY)
                If (assetMapX = xPosF And assetMapY = yPos + 1) Or (assetMapX = xPosB And assetMapY = yPos + 1) Then
                    IsOnFloor = 1
                End If
            End If

        Next si
    End If
    ' Check if on top of other player
    If IsOnFloor = 0 Then
        otherP = Abs(currP - 1)
        If WallCollide2(player(otherP).x, player(otherP).y, 32, 2) = 1 Then
            IsOnFloor = 1
        End If
        'otherpX = (Int(player(otherP).x / tileSize) * tileSize) / tileSize
        'otherpY = (Int(player(otherP).y / tileSize) * tileSize) / tileSize
        '' _Echo "Asset x y pos " + Str$(assetMapX) + "," + Str$(assetMapY)
        'If (otherpX = xPosF And otherpY = yPos + 1) Or (otherpX = xPosB And otherpY = yPos + 1) Then
        '    IsOnFloor = 1
        'End If

    End If

    ' "is on floor " + Str$(IsOnFloor)

End Function